package com.example.demo.day.config.learn.designBook.part11Builder.part3;

import com.example.demo.day.config.learn.designBook.part11Builder.part1.BenzModel;
import com.example.demo.day.config.learn.designBook.part11Builder.part2.BenzBuilder;

import java.util.ArrayList;

public class Director {

    private ArrayList<String> sequence = new ArrayList<>();
    private BenzBuilder benzBuilder = new BenzBuilder();

    /**
     * A类型的奔驰车模型，先start，然后stop，其他什么引擎和喇叭一概没有
     */
    public BenzModel getABenzModel() {
        //清理场景
        this.sequence.clear();
        //这只执行ABenzModel的执行顺序
        this.sequence.add("start");
        this.sequence.add("stop");
        //按照顺序返回一个奔驰车
        this.benzBuilder.setSequence(sequence);
        return (BenzModel) benzBuilder.getCarModel();
    }
    /**
     * B类型的奔驰车.......
     */
}
